async function fetchData(url, params = {}) {
    const response = await fetch(url, {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            'X-Requested-With': 'XMLHttpRequest'
        },
        body: JSON.stringify(params)
    });
    if (!response.ok) throw new Error('请求失败');
    const result = await response.json();
    if (result.code !== 0) {
        throw new Error(result.msg || '业务异常');
    }
    return result.data;
}



async function fetchResponse(url, params = {}) {
    const response = await fetch(url, {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            'X-Requested-With': 'XMLHttpRequest'
        },
        body: JSON.stringify(params)
    });
    if (!response.ok) throw new Error('请求失败');
    const result = await response.json();
    if (result.code !== 0) {
        throw new Error(result.msg || '业务异常');
    }
    return result;
}